<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>欢迎登陆</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <script type="text/javascript" src="/js/jquery-1.11.1.js"></script>
    <script type="text/javascript" src="/js/bootstrap.js"></script>
    <link href="css/login.css" type="text/css" rel="stylesheet" />

</head>
<body id="userlogin_body">

<form id="myForm">
    <div id="user_login">
        <dl>
            <dd id="user_top">
                <ul>
                    <li class="user_top_l"></li>
                    <li class="user_top_c"></li>
                    <li class="user_top_r"></li>
                </ul>
            </dd>
            <dd id="user_main">
                <ul>
                    <li class="user_main_l"></li>
                    <li class="user_main_c">
                        <div class="user_main_box">
                            <ul>
                                <li class="user_main_text">用户名： </li>
                                <li class="user_main_input"><input name="loginname" maxlength="20" id="loginname" class="txtusernamecssclass"> </li>
                            </ul>
                            <ul>
                                <li class="user_main_text">密 码： </li>
                                <li class="user_main_input"><input type="password" name="password" id="password" class="txtpasswordcssclass"> </li>
                            </ul>


                        </div>
                    </li>
                    <li class="user_main_r">
                        <button id="login" type="button" src="img/user_botton.gif" ">提&nbsp;交</button>

                    </li>
                </ul>
            </dd>
            <dd id="user_bottom">
                <ul>
                    <li class="user_bottom_l"></li>
                    <li class="user_bottom_c"></li>
                    <li class="user_bottom_r"></li>
                </ul>
            </dd>
        </dl>
    </div>

</form>
</body>
</html>

<script>
    $(function () {
        $("#login").click(function () {
            $.ajax({
                type: "GET",
                url: "/deng",
                data: $("#myForm").serialize(),
                dataType: "json",
                success: function (vo) {
                    if (vo.code == 200) {
                        var loginname = $("input[name='loginname']").val();
                        alert(loginname);
                        window.location.href = "/pages/stu.html?loginname=" + loginname;
                    } else {
                        alert(vo.msg);
                    }
                }
            });
        });
    })
</script>